package com.example.miscontactos;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class VerMensajesWebs extends Activity 
{
	private TextView txtFrom;
	private String fromUser;
	private EditText txtMensaje;
	private Button btnResponder;
	private static final String FROM = "from";

	@Override
	protected void onCreate(Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_ver_mensajes_webs);
		
		txtFrom = (TextView)findViewById(R.id.txtFrom);
		txtMensaje = (EditText)findViewById(R.id.txtVerMensaje);
		
		fromUser = txtFrom.getText().toString();
		
		btnResponder = (Button) findViewById(R.id.btnResponder);
		btnResponder.setOnClickListener(new OnClickListener() 
		{			
			@Override
			public void onClick(View v) 
			{
				Intent intent = new Intent(VerMensajesWebs.this, CrearMensajeWeb.class);
				intent.putExtra(FROM, fromUser);
    	    	startActivity(intent);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) 
	{
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_ver_mensajes_webs, menu);
		return true;
	}

}
